package com.zerui.manager.web.cmd;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.*;
import java.time.LocalDate;
import java.time.LocalTime;

/**
 * @Author wh
 * @create_time 2023-05-31 11:00
 */
@Getter
@Setter
@ToString
public class AccessAuthAddCmd {

    @ApiModelProperty(value="门禁组名称")
    @NotBlank(message = "设备分组名称不能为空")
    @Size(min = 1,max = 30)
    private String name;

	@ApiModelProperty("日期类型 0:始终有效 1：日期范围")
	@NotNull(message = "有效日期不能为空")
	@Min(0)
	@Max(1)
	private Integer dateType;

	@ApiModelProperty("有效日期 - 开始")
	@JsonFormat(pattern = "yyyy/MM/dd")
	private LocalDate startDate;

	@ApiModelProperty("有效日期 - 结束")
	@JsonFormat(pattern = "yyyy/MM/dd")
	private LocalDate endDate;

	@ApiModelProperty("时间类型 0:全体有效 1：时间范围")
	@NotNull(message = "有效时间不能为空")
	@Min(0)
	@Max(1)
	private Integer timeType;

	@ApiModelProperty("有效时间 - 开始")
	@JsonFormat(pattern = "HH:mm")
	private LocalTime startTime;

	@ApiModelProperty("有效时间 - 结束")
	@JsonFormat(pattern = "HH:mm")
	private LocalTime endTime;

	@ApiModelProperty("备注")
	private String remark;

}
